<?php $this->load->view('admin/_begin') ?>
<?php $this->load->view('admin/' . $this->router->fetch_class() . '/_filter') ?>
<form accept-charset="utf-8" method="post" action="<?php echo site_url('admin/'.$this->router->fetch_class() . '/action') ?>">	
  <div id="filter-stage" style="display: block;">	
    <table border="0" class="table-list">
      <thead>
        <tr>
          <th class="align-center" with="30">
            <input type="checkbox" class="check-all" value="" name="action_to_all">
          </th>
          <th><?php echo $this->lang->line('label.user.name') ?></th>
          <th><?php echo $this->lang->line('label.user.group') ?></th>
          <th class="collapse"><?php echo $this->lang->line('label.user.is_active') ?></th>
          <th class="collapse"><?php echo $this->lang->line('label.user.created_on') ?></th>
          <th class="collapse"><?php echo $this->lang->line('label.user.last_visit') ?></th>
          <th></th>
        </tr>
      </thead>
      <tbody>
        <?php if (empty($objects)) { ?>
          <tr>
            <td colspan="7">
              <div class="no_data"><?php echo $this->lang->line('label.empty.data', 
                    $this->lang->line('label.'.$this->router->fetch_class().'s'))?></div>
            </td>
          </tr>
        <?php } foreach ($objects as $user) { ?>
          <tr>
            <td class="align-center">
              <input type="checkbox" value="<?php echo $user['id'] ?>" name="action_to[]">
            </td>
            <td>
              <a class="" href="<?php echo site_url('admin/user/show/' . $user['id']) ?>">
                <?php echo $this->user_model->to_string($user) ?>
              </a>
            </td>
            <td>
              <a href="<?php echo site_url('admin/group/show/' . $user['group_id']) ?>">
                <?php echo $this->group_model->to_string($user['group_id']) ?>
              </a>
            </td>
            <td class="collapse"><?php echo $user['is_active'] ? $this->lang->line('label.yes') : $this->lang->line('label.no') ?></td>
            <td class="collapse"><?php echo empty($user['created_on']) ? '' : date($this->setting_model->item('date_format'), $user['created_on']) ?></td>
            <td class="collapse"><?php echo empty($user['last_login']) ? '' : date($this->setting_model->item('date_format'), $user['last_login']) ?></td>
            <td class="actions">
              <a class="btn orange edit" href="<?php echo site_url('admin/'.$this->router->fetch_class() . '/edit/' . $user['id']) ?>">
                <?php echo $this->lang->line('btn.edit') ?></a>
              <a class="confirm btn red delete" style="margin-left: 5px"
                 href="<?php echo site_url('admin/'.$this->router->fetch_class() . '/delete/' . $user['id']) ?>"><?php echo $this->lang->line('btn.delete') ?></a>
            </td>
          </tr>
        <?php } ?>
      </tbody>
    </table>  
    <div class="paging"><?php echo $paging ?></div>
  </div>  
  <div class="table_action_buttons">
    <button class="btn blue" value="activate" name="btnAction" type="submit" disabled="disabled">
      <span><?php echo $this->lang->line('btn.activate') ?></span>
    </button>
    <button class="btn orange" value="deactivate" name="btnAction" type="submit" disabled="disabled">
      <span><?php echo $this->lang->line('btn.deactivate') ?></span>
    </button>
    <button class="btn red confirm" value="delete" name="btnAction" type="submit" disabled="disabled">
      <span><?php echo $this->lang->line('btn.delete') ?></span>
    </button>
  </div>
</form>
<?php $this->load->view('admin/_end') ?>